<?php
class AutocompleteController extends Zend_Controller_Action
{
    public function init ()
    {    
    	Zend_Loader::loadClass("AutocompleteModel");
    }
    
    public function indexAction ()
    {    
    	exit();
    }
    
    /**
     * @name userAction
     * Action for autocomplete with user data
     * @return json_encode
     */
    public function userAction ()
    {
        $request = $this->getRequest();
        $term = $request->getParam("term");

        $arr = AutocompleteModel::getUsers($term);
        echo json_encode($arr);
        
        exit();
    }
}
